home *** CD-ROM | disk | FTP | other *** search
- ; very basic program to display mouse cursor on screen in graphics mode
- .model small
- .stack 0100h
-
- .data
- message db " Press any key to exit$"
- err_message db 12 dup(10, 13)
- db " A mouse drive must first be loaded in memory"
- db 10, 13
- db " prior to running this program!"
- db 12 dup(10, 13)
- db "$"
-
- .code
- start:
-
- ; initialize the mouse
- xor ax, ax
- int 33h
-
- ; check to see if mouse is installed
- cmp ax,0000h
-
- ; proceed if mouse driver loaded
- jnz it_lives
-
- ; if not, then exit
- jmp error
-
- ; begin mouse routine
- it_lives:
-
- ; change to graphics mode 12
- mov ah, 00h
- mov al, 12h
- int 10h
-
- ; display message
- mov ax, @data
- mov ds, ax
- mov dx, offset message
- mov ah, 09h
- int 21h
-
- ; make mouse cursor visible on screen
- mov ax, 0001h
- int 33h
-
- ; wait for keypress
- mov ah, 00h
- int 16h
-
- ; hide mouse cursor and return sreen mode
- ;mov ax, 0002h
- ;int 33h
-
- mov ah, 00h
- mov al, 03h
- int 10h
-
- jmp exit
- ; no mouse loaded so, exit with error message
- error:
- mov ax, @data
- mov ds, ax
- mov dx, offset err_message
- mov ah, 09h
- int 21h
-
- ; terminate program
- exit:
- mov ah, 04ch
- int 21h
-
- end start
-
-